/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.hk.sys.service.adv;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.hk.sys.entity.adv.HkCategory;
import com.thinkgem.jeesite.modules.hk.sys.dao.adv.HkCategoryDao;

/**
 * 乐看系统分类Service
 * @author 罗天文
 * @version 2018-04-13
 */
@Service
@Transactional(readOnly = true)
public class HkCategoryService extends TreeService<HkCategoryDao, HkCategory> {

	public HkCategory get(String id) {
		return super.get(id);
	}
	
	public List<HkCategory> findList(HkCategory hkCategory) {
		if (StringUtils.isNotBlank(hkCategory.getParentIds())){
			hkCategory.setParentIds(","+hkCategory.getParentIds()+",");
		}
		return super.findList(hkCategory);
	}
	
	@Transactional(readOnly = false)
	public void save(HkCategory hkCategory) {
		super.save(hkCategory);
	}
	
	@Transactional(readOnly = false)
	public void delete(HkCategory hkCategory) {
		super.delete(hkCategory);
	}
	
}